Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Fix GH-103: Create SWF regardless of platform #107

Merged

Conversation

cwillisf
Copy link
Contributor

@cwillisf cwillisf commented Jan 4, 2017

Port LLK/scratchr2#4168 for ScratchX.

Note that this change adds Bowser as a ScratchX dependency. For consistency, I used the same version that we currently use in scratchr2.

Original description from LLK/scratchr2#4168:

This fixes #4112 by creating the swf regardless of OS and browser. Calling embedSWF would first check for the existence of the plugin before creating, causing browsers that don’t allow the flash plugin by default to not be able to show their “allow” message. This tries to create the swf no matter what, allowing browsers to detect flash themselves.

Logic is as follows:

  1. check if userAgent returns a mobile/tablet OS. Display error message if so
  2. check if on windows and using ie – check for an express install if so (like in embedSWF)
  3. load the swf in all other cases, let browsers handle it.

Test Cases:

  • Test how project pages load in Android and iOS devices, on tablets and on phones, and on multiple desktop OS's for correct loading behavior.

This resolves #103

Port LLK/scratchr2#4168 for ScratchX.

Original description from that change:
> This fixes #4112 by creating the swf regardless of OS and browser.
> Calling `embedSWF` would first check for the existence of the plugin
> before creating, causing browsers that don’t allow the flash plugin by
> default to not be able to show their “allow” message. This tries to
> create the swf no matter what, allowing browsers to detect flash
> themselves.
>
> Logic is as follows:
> 1. check if `userAgent` returns a mobile/tablet OS. Display error
>    message if so
> 2. check if on windows and using ie – check for an express install if
>    so (like in `embedSWF`)
> 3. load the swf in all other cases, let browsers handle it.
>
> Test Cases:
> - Test how project pages load in Android and iOS devices, on tablets
>   and on phones, and on multiple desktop OS's for correct loading
>   behavior.

This resolves scratchfoundation#103
Copy link

@mewtaylor mewtaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks @cwillisf !

@mewtaylor mewtaylor removed their assignment Jan 4, 2017
@rschamp rschamp removed their assignment Jan 5, 2017
@cwillisf cwillisf merged commit ce75fab into scratchfoundation:gh-pages Jan 5, 2017
@cwillisf cwillisf deleted the create-swf-on-all-platforms branch January 5, 2017 18:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update ScratchX with changes that increase compatibility with Safari
3 participants